<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="header.jsp" %>
<center>
    <hr/>
    <img src='images/top1.jpg' width='100%'>
    <hr/>
</center>
<br/>
<center><img src='images/u6.png' height=70px><font size='+4' face='楷体' color='#7D26CD'><b>更新失物招领信息</b></font>
</center>
<hr/>
<center>
    <% Msg msg = (Msg) request.getAttribute("msg");%>
    <% out.println("<form action='ChangeMsgServlet?mid=" + msg.getMid() + "' method='post' enctype='multipart/form-data' >");%>
    <table>
        <tr><br/>
            <td>
                失物:
            </td>
            <td>

                <%

                    out.println("<input type='text' name='name' value='" + msg.getName() + "'/>");
                %>
            </td>
        </tr>
        <tr>
            <td>
                图片:
            </td>
            <td>
                <%
                    out.println("<img src='images/pho/" + msg.getPhoto() + ".jpg' width='200' height='220'/>");%>
                <br/>
                <%--                <label for="file">选择图片：</label>--%>
                <%--                <input type="file" name="photo" id="file" accept="image/*">--%>
            </td>
        </tr>
        <tr>
            <td>
                信息类型:
            </td>
            <td>
                <select name='type' style='width:170px;'>
                    <%
                        if (msg.getType().equals("失物")) {
                            out.println(" <option value='失物' selected>失物</option> " +
                                    "<option value='招领'>招领</option>");
                        } else {
                            out.println(" <option value='失物'>失物</option> " +
                                    "<option value='招领' selected>招领</option>");
                        }
                    %>
                </select>
            </td>
        </tr>
        <tr>
            <td>
                承诺酬金:
            </td>
            <td>
                <% out.println("<input type='number' name='money' style='width:250px;' value='" + msg.getMoney() + "'/>"); %>
            </td>
        </tr>
        <tr>
            <td>
                发生区域:
            </td>
            <td>
                <% out.println("<input type='text' name='area' style='width:250px;' value='" + msg.getArea() + "'/>"); %>
            </td>
        </tr>
        <tr>
            <td>
                联系人位置:
            </td>
            <td>
                <% out.println("<input type='text' name='xiaoqu' style='width:250px;' value='" + msg.getXiaoqu() + "'/>"); %>
            </td>
        </tr>
        <tr>
            <td>
                联系电话:
            </td>
            <td>
                <% out.println("<input type='number' name='tel' style='width:250px;' value='" + msg.getTel() + "'/>"); %>
            </td>
        </tr>
        <tr>
            <td>
                状态:
            </td>
            <td>
                <select name='flag' style='width:170px;'>
                    <%
                        if (msg.getFlag().equals("未锁定")) {
                            out.println(" <option value='未锁定' selected>未锁定</option> " +
                                    "<option value='已锁定'>已锁定</option>");
                        } else {
                            out.println(" <option value='未锁定'>未锁定</option> " +
                                    "<option value='已锁定' selected>已锁定</option>");
                        }
                    %>
                </select>
            </td>
        </tr>
        <tr>
            <td>
                其他介绍:
            </td>
            <td>
<textarea name='detail' style='height:200px;width:350px'><%out.println(msg.getDetail());%></textarea>
            </td>
        </tr>
        <tr>
            <td colspan='2'><br/>
                <input type='submit' value='更改' style='width:500px;height:30px'/>
            </td>
        </tr>
    </table>
    </form>
</center>
<%@ include file="footer.jsp" %>
